Javascript Actions Editor

Description

Opens the Javascript Actions Editor which allows for the creation of unbound events.

images/jae5.png
Opening the Javascript Actions Editor on the UX Controls page

A standard way to access the Javascript Actions Editor is to first add a control to the controls tree, on the UX Controls page, and then define an javascript event for that control, for example 'onClick' or 'down'. Doing this automatically opens the Javascript Editor where you can define an action, or some free-form javascript, for the specified event on the specified control. Because these events are tied to a specific event they can be referred to as a 'bound event'.

It is also possible to define 'unbound events' in the UX Builder. It is not necessary to have an event in place before creating a Javascript Action that defined what will happen when some javascript code is executed. You can create unbound events by opening the Javascript Actions Editor in the Additional Options Menu even before you have added a single control to the component.

Because the action javascript created for unbound events is not yet tied to anything, it is necessary to create a name for the action before it is defined. When you access the Javascript Actions Editor directly from the 'Additional Options Menu' you will need to press an 'Add' button.

images/jae.png

The Editor will then prompt you to name the action.

images/jae2.png

To define the action, highlight the new action and click the Edit Action button.

images/jae3.png

The Edit Unbound Event editor will open allowing you to create an unbound action.

images/jae4.png

If you are using the Action Javascript option you can visit the 'Action Javascript' page to see a list of all of the actions available in Alpha Anywhere. For a list of actions specific to the UX Component visit the 'Action Javascript for the UX' page.

Creating a new Button to Execute an Action

The Create button to execute selected action link at the bottom of the editor can be used to add a button to the UX to execute an action. To add a button:

  1. Open the editor, select the action you want to run, and click the Create button to execute selected action hyperlink. This will create a new button control and place the control on the clipboard.

    Javascript Actions Editor with the "Create a button" link highlighted
    Javascript Actions Editor with the "Create a button" link highlighted
  2. Next, Controls pane in the UX Builder. Select the position where you want to insert the button, and press Ctrl-V to insert the button from the clipboard. The button will be inserted after the selected control.